#pragma once
#include "Vector3.h"
#define PI 3.1415926535f
#include "Matrix.h"
namespace FIRSTDX
{
	class Camera
	{
		vec3f m_pos;
		vec3f m_velocity;
		vec3f m_rotation;
		float m_drag;
		vec3f m_direction;
		vec3f m_scale;
		vec3f m_up;

		vec3f m_offset;//camera chase
		const vec3f m_const_offsetValue;
		vec3f m_targetRotation;// LERP to the 3rd person

		Matrix4f m_view;
		Matrix4f m_projection;

	public:	Matrix4f m_MV_matrix;

	public:
		Camera();
		const vec3f& position() const;
		void setPosition(const vec3f& position);
		void applyImpulse(const vec3f& impulse);
		void applyImpulseWorldBasis(const vec3f& impulse);
		const vec3f& getRotation();//degree
		const vec3f& setRotation(const vec3f& rotation);
		void rotate(const vec3f& change);
		void scale(const float scaleValue);
		void setViewTransformation();
		
		const vec3f& getDirection();
		inline vec3f& getUp(){return m_up;}
		//camera up

		vec3f& getOffset(){return m_offset;}
		void moveTo( vec3f& modelPos );
		void updatePos();
		void initializeView();
		Matrix4f setProjection(float fov, float aspect,float znear, float zfar);
		inline Matrix4f getProjection(){return m_projection;}
		inline Matrix4f getViewMatrix(){return m_view;}
		
	};
}